Focus detection device and image-capturing apparatus

ABSTRACT

A focus detection device includes: an image sensor that includes a plurality of focus detection pixel rows, each having a plurality of focus detection pixels and each outputting a pair of focus detection signals; a spatial accumulation unit that calculates spatially accumulated values by adding together pairs of focus detection signals output from a first predetermined number of focus detection pixel rows among the plurality of focus detection pixel rows; and a focus detection unit that detects a focusing condition at an optical system based upon the spatially accumulated values.

CROSS-REFERENCE TO RELATED APPLICATIONS

This is a Continuation of application Ser. No. 14/432,020 filed Mar. 27,2015, which in turn is a National Phase of International Application No.PCT/JP2013/075419 filed Sep. 20, 2013, which claims the benefit ofJapanese Application No. 2012-217303 filed Sep. 28, 2012. The disclosureof the prior applications is hereby incorporated by reference herein inits entirety.

TECHNICAL FIELD

The present invention relates to a focus detection device and animage-capturing apparatus.

BACKGROUND ART

Focus detection pixels, each comprising a micro-lens and a pair ofphotoelectric conversion units disposed to the rear of the micro-lens,are arrayed on a predetermined focal plane of a photographic lens. Viathis array, a pair of image signals corresponding to a pair of imagesformed with a pair of focus detection light fluxes passing through anoptical system are generated. The focusing condition (a defocus amountindicating the extent of defocus) at the photographic lens is determinedby detecting an image shift amount (phase difference), i.e., the extentof image shift manifested by the pair of image signals. A focusdetection device engaged in such an operation is known in the relatedart as a focus detection device adopting the split-pupil phase detectionmethod.

Focus detection is executed concurrently as a live view image display isprovided by reading out focus detection pixel signals andimage-capturing pixel signals over predetermined specific frame timeintervals from an image-capturing element (image sensor) configured withfocus detection pixels such as those described above and image-capturingpixels disposed thereat in combination. In addition, the signals fromthe focus detection pixels output in correspondence to a plurality ofprevious frames are stored frame by frame. If the signals from the focusdetection pixels for the most recent frame fail to achieve a sufficientoutput level and thus the focusing condition cannot be detected inconjunction with these signals alone, the focus detection pixel signalsstored over the plurality of past frames are added together for temporalaccumulation. There is a focus detection device known in the related art(see patent literature 1) that executes focus detection based upon focusdetection pixel signals with the output level thereof raised throughsuch measures.

CITATION LIST Patent Literature

PTL1: Japanese Laid Open Patent Publication No. 2008-85738

SUMMARY OF INVENTION Technical Problem

There is an issue that needs to be addressed in the focus detectiondevice described above in that an error may occur in the focus detectionresults obtained in relation to a moving subject.

Solution to Problem

A focus detection device according to a first aspect of the presentinvention comprises: an image sensor that includes a plurality of focusdetection pixel rows, each having a plurality of focus detection pixelsand each outputting a pair of focus detection signals; a spatialaccumulation unit that calculates spatially accumulated values by addingtogether pairs of focus detection signals output from a firstpredetermined number of focus detection pixel rows among the pluralityof focus detection pixel rows; and a focus detection unit that detects afocusing condition at an optical system based upon the spatiallyaccumulated values.

According to a second aspect of the present invention, in the focusdetection device according to the first aspect, it is preferable tofurther comprise: a temporal accumulation unit that calculatestemporally accumulated values based upon the spatially accumulatedvalues. The first predetermined number of focus detection pixel rowseach repeatedly output the pair of focus detection signals over apredetermined time interval; each time the first predetermined number offocus detection pixel rows each output the pair of focus detectionsignals after the predetermined time interval, the spatial accumulationunit calculates the spatially accumulated values by adding up the pairsof focus detection signals output from the first predetermined number offocus detection pixel rows; the temporal accumulation unit calculatesthe temporally accumulated values by adding up a second predeterminednumber of spatially accumulated values obtained as the spatialaccumulation unit repeatedly calculates the spatially accumulatedvalues; and the focus detection unit detects the focusing conditionbased upon one of the spatially accumulated values and the temporallyaccumulated values calculated based upon the spatially accumulatedvalues.

According to a third aspect of the present invention, in the focusdetection device according to the second aspect, it is preferable thatthe first predetermined number of focus detection pixel rows are eachformed with the plurality of focus detection pixels disposed along thepredetermined direction, and each repeatedly output the pair of focusdetection signals corresponding to a pair of images formed with a pairof focus detection light fluxes, generated through photoelectricconversion, over the predetermined time interval.

According to a fourth aspect of the present invention, in the focusdetection device according to the third aspect, it is preferable thatthe first predetermined number and the second predetermined number aredetermined so that an evaluation value calculated based upon the pairsof focus detection signals exceeds a predetermined threshold value whenthe focus detection unit detects the focusing condition based upon thetemporally accumulated values.

According to a fifth aspect of the present invention, in the focusdetection device according to the fourth aspect, it is preferable thatwhen the focus detection unit detects the focusing condition based uponthe spatially accumulated values, the evaluation value is a firstcumulative value determined based upon the spatially accumulated values,with the first predetermined number set within a range under a maximumnumber and the second predetermined number set to 0 so that the firstcumulative value exceeds the predetermined threshold value, whereas whenthe focus detection unit detects the focusing condition based upon thetemporally accumulated values, the evaluation value is a secondcumulative value determined based upon the temporally accumulatedvalues, with the first predetermined number set to the maximum numberand the second predetermined number set so that the second cumulativevalue exceeds the predetermined threshold value.

According to a sixth aspect of the present invention, in the focusdetection device according to the fifth aspect, it is preferable tofurther comprise: a storage device in which the pair of focus detectionsignals is stored each time the first predetermined number of focusdetection pixel rows each output the pair of focus detection signalsafter the predetermined time interval. The spatial accumulation unitcalculates the spatially accumulated values by adding up the pairs offocus detection signals stored in the storage device.

According to a seventh aspect of the present invention, in the focusdetection device according to the fifth aspect, it is preferable tofurther comprise: a storage device in which the spatially accumulatedvalues calculated by the spatial accumulation unit are stored each timethe first predetermined number of focus detection pixel rows each outputthe pair of focus detection signals after the predetermined timeinterval. The temporal accumulation unit calculates the temporallyaccumulated values by adding up the second predetermined number ofspatially accumulated values stored in the storage device.

According to an eighth aspect of the present invention, in the focusdetection device according to the fifth aspect, it is preferable tofurther comprise: a storage device in which the temporally accumulatedvalues calculated by the temporal accumulation unit are stored each timethe first predetermined number of focus detection pixel rows each outputthe pair of focus detection signals after the predetermined timeinterval. When detecting the focusing condition based upon thetemporally accumulated values, the focus detection unit detects thefocusing condition based upon that temporally accumulated values storedin the storage device.

According to a ninth aspect of the present invention, in the focusdetection device according to the fourth aspect, it is preferable tofurther comprise: a movement detection unit that detects an extent ofmovement occurring in the pair of images during the predetermined timeinterval. When the focus detection unit detects the focusing conditionbased upon the temporally accumulated values, the first predeterminednumber and the second predetermined number are determined so that avalue taken for the second predetermined number becomes smaller relativeto a value taken for the first predetermined number as the extent ofmovement increases and that a product of the first predetermined numberand the second predetermined number is substantially equal to a constantvalue corresponding to the evaluation value and the predeterminedthreshold value.

According to a tenth aspect of the present invention, in the focusdetection device according to any one of the fifth to eighth aspects, itis preferable that the first cumulative value and the second cumulativevalue correspond to an average value of the spatially accumulated valuesand an average value of the temporally accumulated values, a largestvalue of the spatially accumulated values and a largest value of thetemporally accumulated values, or a difference between the largest valueand the smallest value of the spatially accumulated values and adifference between the largest value and the smallest value of thetemporally accumulated values.

According to an eleventh aspect of the present invention, in the focusdetection device according to the ninth aspect, it is preferable thatthe evaluation value corresponds to one of an average value of valuesindicated by the pairs of focus detection signals, a largest valueindicated by the pairs of focus detection signals and a differencebetween the largest value and a smallest value indicated by the pairs offocus detection signals.

According to a twelfth aspect of the present invention, in the focusdetection device according to any one of the third to eleventh aspects,it is preferable that the plurality of focus detection pixels eachinclude a micro-lens through which the pair of focus detection lightfluxes pass and a pair of photoelectric conversion units setside-by-side along the predetermined direction, where the pair of focusdetection light fluxes received thereat undergo photoelectricconversion; and via the micro-lens, the pair of photoelectric conversionunits and a pair of areas through which the pair of focus detectionlight fluxes pass, set side-by-side along a direction parallel to thepredetermined direction as part of an exit pupil of the optical system,achieve a conjugate relation to each other.

According to a thirteenth aspect of the present invention, in the focusdetection device according to the twelfth aspect, it is preferable thata plurality of image-capturing pixels that output, over a predeterminedtime interval, subject image signals corresponding to a subject imagegenerated through photoelectric conversion of a photographic light flux,having originated from a subject, passed through the optical system andreceived thereat, are disposed at the image sensor in combination withthe plurality of focus detection pixels.

According to a fourteenth aspect of the present invention, in the focusdetection device according to the third aspect, it is preferable thatthe plurality of focus detection pixels forming the first predeterminednumber of focus detection pixel rows each receive the pair of focusdetection light fluxes having passed through a pair of areas that arepart of an exit pupil of the optical system and are set side-by-sidealong a direction parallel to the predetermined direction; and theplurality of focus detection pixel rows are disposed so as to extendparallel to one another.

An image-capturing apparatus according to a fifteenth aspect of thepresent invention comprises: a focus detection device according to anyone of the first to fourteenth aspects; a drive unit that drives theoptical system to a focus match position based upon the focusingcondition detected by the focus detection unit; and an acquisition unitthat obtains image data based upon a photographic light flux havingoriginated from a subject and passed through the optical system when theoptical system is set at the focus much position.

Advantageous Effects of Invention

The focus detection device according to the present invention is capableof highly accurate focus detection.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 A lateral sectional view showing the structure of a digital stillcamera

FIG. 2 A block diagram indicating in detail the relationship between animage-capturing element and a body drive control device

FIG. 3 An illustration indicating a focus detection position set on thephotographic image plane

FIG. 4 A front view showing the structure of an image-capturing elementin detail

FIG. 5 A front view showing the structure of the image-capturing elementin detail

FIG. 6 An illustration of the structure of a focus detection opticalsystem engaged in focus detection through the split-pupil phasedetection method enabled via micro-lenses

FIG. 7 An illustration showing how a photographic light flux is receivedat image-capturing pixels

FIG. 8 A flowchart of an image-capturing operation that includes thefocus detection operation executed as a part thereof in the digitalstill camera

FIG. 9 A flowchart of the processing executed to generate focusdetection data

FIG. 10 A diagram illustrating how the spatial accumulation processingis executed

FIG. 11 A diagram illustrating how the temporal accumulation processingis executed

FIG. 12 A timing chart pertaining to the processing operation executedfor focus detection data generation

FIG. 13 A flowchart of processing that may be executed to generate focusdetection data

FIG. 14 A diagram illustrating how temporal accumulation processing maybe executed

FIG. 15 A flowchart of processing that may be executed to generate focusdetection data

FIG. 16 A graph in reference to which the processing executed todetermine the number of spatial accumulation operations to be executedand the number of temporal accumulation operations to be executed willbe explained in detail

FIG. 17 A front view showing the structure of an image-capturing elementin detail

DESCRIPTION OF EMBODIMENTS

(First Embodiment)

FIG. 1 is a lateral sectional view illustrating the structure of adigital still camera 201 with an interchangeable lens, representing anexample of an image-capturing apparatus equipped with a focus detectiondevice achieved in the first embodiment of the present invention. Thedigital still camera 201 comprises an interchangeable lens 202 and acamera body 203. The interchangeable lens 202, i.e., one of variousinterchangeable lenses, is mounted at the camera body 203 via a mountunit 204.

The interchangeable lens 202 includes a lens 209, a zooming lens 208, afocusing lens 210, an aperture 211 and a lens drive control device 206.The lens drive control device 206 is constituted with a microcomputer, amemory, a drive control circuit and the like (none shown). The lensdrive control device 206 executes drive control for focus adjustment atthe focusing lens 210 and for opening diameter adjustment at theaperture 211 and detects the states of the zooming lens 208, thefocusing lens 210 and the aperture 211. In addition, the lens drivecontrol device 206 engages in communication with a body drive controldevice 214 to be detailed later to transmit lens information to the bodydrive control device 214 and receive camera information from the bodydrive control device 214. The aperture 211 forms an opening, thediameter of which can be adjusted, centered on the optical axis forpurposes of light amount adjustment and adjustment of the extent ofblurring.

An image-capturing element (image sensor) 212, the body drive controldevice 214, a liquid crystal display element drive circuit 215, a liquidcrystal display element 216, an eyepiece lens 217, a memory card 219 andthe like are disposed at the camera body 203. A plurality ofimage-capturing pixels are two-dimensionally arrayed at theimage-capturing element 212 and a plurality of focus detection pixelsare also built into the image-capturing element over an areacorresponding to a focus detection position. The image-capturing element212 will be described in detail later.

The body drive control device 214 includes a microcomputer, a memory, adrive control circuit and the like. The body drive control device 214 isengaged in repeated execution of drive control for the image-capturingelement 212, read of image signals and focus detection signals, focusdetection operation based upon focus detection signals and focusadjustment for the interchangeable lens 202, and also processes andrecords the image signals, controls camera operations and the like. Thebody drive control device 214 also engages in communication with thelens drive control device 206 via an electrical contact point 213 toreceive the lens information and transmit the camera information(indicating a defocus amount, an aperture number and the like).

The liquid crystal display element 216 functions as an electronicviewfinder (EVF). A live view image is brought up on display at theliquid crystal display element 216 by the liquid crystal display elementdrive circuit 215 based upon image signals provided via theimage-capturing element 212. The live view image can be observed by thephotographer via the eyepiece lens 217. The memory card 219 is an imagestorage medium in which image data generated based upon image signalsobtained by capturing an image at the image-capturing element 212 arestored.

A subject image is formed on the light-receiving surface of theimage-capturing element 212 with a light flux having passed through theinterchangeable lens 202. The subject image undergoes photoelectricconversion at the image-capturing element 212 and subsequently, imagesignals and focus detection signals are transmitted to the body drivecontrol device 214.

The body drive control device 214 calculates the defocus amountindicating the extent of defocus based upon focus detection signalsoutput from focus detection pixels at the image-capturing element 212and transmits this defocus amount to the lens drive control device 206.In addition, the body drive control device 214 generates image data byprocessing the image signals provided from the image-capturing element212 and stores the image data thus generated into the memory card 219.It also provides live view image signals from the image-capturingelement 212 to the liquid crystal display element drive circuit 215 soas to bring up a live view image on display at the liquid crystaldisplay element 216. Moreover, the body drive control device 214provides aperture control information to the lens drive control device206 to enable control of the opening at the aperture 211.

The lens drive control device 206 updates the lens information incorrespondence to the current focusing state, zooming state and aperturesetting state, the maximum aperture number and the like. Morespecifically, the lens drive control device 206 detects the positions ofthe zooming lens 208 and the focusing lens 210 and the aperture numberset for the aperture 211, and calculates lens information based upon thelens positions and the aperture number. Alternatively, it may select thelens information corresponding to the lens positions and the aperturenumber from a lookup table prepared in advance.

The lens drive control device 206 calculates a lens drive quantityindicating the extent to which the lens is to be driven based upon thedefocus amount received thereat and drives the focusing lens 210 to afocus match position based upon the lens drive quantity. The lens drivecontrol device 206 also drives the aperture 211 in correspondence to theaperture number it has received.

FIG. 2 is a block diagram illustrating in detail the aspect of therelationship between the image-capturing element 212 and the body drivecontrol device 214 that pertains to the present invention. As FIG. 2indicates, an image-capturing element control unit 220, a buffer memory221, a CPU (microcomputer) 222 and an internal memory 223 are installedin the body drive control device 214. Under control executed by theimage-capturing element control unit 220, the image-capturing element212 controls charge storage (the charge storage duration and the timingof charge storage) at the image-capturing pixels and the focus detectionpixels and also controls output of the image signals and the focusdetection signals. The image signals corresponding to a subject imageand the focus detection signals corresponding to a pair of images, aswill be explained later, read out from the image-capturing element 212by the image-capturing element control unit 212 first undergopreliminary processing such as signal amplification and A/D conversionand are then temporarily stored as data for a single frame into thebuffer memory 221. The CPU 222 executes image processing of the knownart on the image signals included in the single-frame data stored in thebuffer memory 221 so as to provide an image display and record theimage. The CPU 222 also executes focus detection processing, as will beexplained later, based upon the focus detection signals included in thesingle-frame data stored in the buffer memory 221. The internal memory223 is used to store focus detection signals for a plurality of pastframes. The CPU 222 executing the focus detection processing referencesthe focus detection signals corresponding to the past frames stored inthe internal memory 223. Once the focus detection processing executed inconjunction with the focus detection signals for the most recent frameis completed, the focus detection signals in the most recent frame data,temporally stored in the buffer memory 221, are transferred into theinternal memory 223. The internal memory 223 assumes an FILO (first inlast out) stacked structure, whereby the recorded contents in theinternal memory 223 are sequentially updated so that the focus detectionsignals corresponding to a predetermined number of immediate past framesare held therein.

FIG. 3 shows a focus detection area set on the photographic image plane,which represents an example of an area (a focus detection area, a focusdetection position) where an image is sampled on the photographic imageplane when focus detection is executed via a focus detection pixel groupat the image-capturing element 212, as will be detailed later. A focusdetection area 101 in this example is set at the center of a rectangularphotographic image plane 100. Focus detection pixels are disposed incorrespondence to the rectangular focus detection area 101.

FIG. 4 and FIG. 5 each show in detail the structure of theimage-capturing element 212 in an enlarged front view of the focusdetection area 101 at the image-capturing element 212. FIG. 4 shows howimage-capturing pixels 310 and focus detection pixels 311 are laid out.As FIG. 4 indicates, the image capturing pixels 310 and the focusdetection pixels 311 are arrayed together in a dense two-dimensionalsquare grid pattern at the image-capturing element 212. Focus detectionpixels 311 are disposed at every other position in each of a pluralityof pixel rows extending along the horizontal direction, thereby formingfocus detection pixel rows L1 through L8. FIG. 5 shows the color filterarray pattern with which color filters are disposed at theimage-capturing pixels 310 and the focus detection pixels 311 in FIG. 4.Color filters, i.e., red color filters R, green color filters G and bluecolor filters B, are disposed at the image-capturing pixels 310 and thefocus detection pixels 311 in conformance to the Bayer array rules. Thered color filters R, the green color filters G and the blue colorfilters B demonstrate high levels of spectral sensitivity overwavelength ranges different from one another. The green color filters Gare disposed at the focus detection pixels 311. A phase differencemanifesting along the horizontal direction is detected based upon data(focus detection signals) originating from the plurality of focusdetection pixels 311 disposed in the focus detection pixel rows L1through L8 extending along the horizontal direction. The data from theplurality of focus detection pixels 311 disposed in the focus detectionpixel row L1 are normally used for focus detection. Under certaincircumstances, the data from the plurality of focus detection pixels 311disposed in a focus detection pixel row among the focus detection pixelrows L2 through L8 are added to the data from the corresponding focusdetection pixels 311 disposed in the focus detection pixel row L1 andthe resulting cumulative values are used in the focus detection. Such anaccumulation operation, through which data from focus detection pixels311 taking up spatial positions different from each other are added up,will be hereafter referred to as “spatial accumulation”.

The image-capturing pixels 310 each comprise a rectangular micro-lens 10and a photoelectric conversion unit 11 with a light receiving areathereof restricted by a light-shielding mask (not shown). The focusdetection pixels 311 each comprise a rectangular micro-lens 10 and apair of photoelectric conversion units 13 and 14 formed by splitting thephotoelectric conversion unit 11 of an image-capturing pixel 310 intotwo parts via an element separation area 15 ranging along the verticaldirection. It is to be noted that in order to simplify the illustration,FIG. 4 does not show any color filters.

The image-capturing pixels 310 are designed so that their shape allows alight flux passing through the exit pupil of the fastest interchangeablelens (e.g., f 1.0) to be received in its entirety at the photoelectricconversion units 11 via the micro-lenses 10. In addition, the focusdetection pixels 311 are designed so that their shape allows a pair offocus detection light fluxes passing through a pair of areas, setside-by-side along a direction parallel to the direction in which thepair of photoelectric conversion units 13 and 14 are set side-by-side,at the exit pupil of the interchangeable lens 202 to be respectivelyreceived at the photoelectric conversion units 13 and 14 via themicro-lenses 10.

FIG. 6 shows the structure of a focus detection optical system used todetect the focusing condition via micro-lenses 10 through thesplit-pupil phase detection method. FIG. 6 provides an enlargedschematic illustration of three focus detection pixels 311 and twoimage-capturing pixels 310, taking up successive positions near aphotographic optical axis 91 in the focus detection pixel row L1extending along the horizontal direction in the focus detection area101. An exit pupil 90 in FIG. 6 is set over a distance d along thefrontward direction from the micro-lenses 10 disposed at thepredetermined image-forming plane of the interchangeable lens 202 (seeFIG. 1). The distance d is determined in correspondence to the curvatureof the micro-lenses 10, the refractive index of the micro-lenses 10, thedistance between the micro-lenses 10 and the photoelectric conversionunits 13 and 14 and the like, and is referred to as a focus detectionpupil distance in this description. FIG. 6 also shows the optical axis91 of the interchangeable lens, micro-lenses 10, photoelectricconversion units 13 and 14, focus detection pixels 311, image-capturingpixels 310 and focus detection light fluxes 73 and 74.

A focus detection pupil 93 is formed as a photoelectric conversion unit13, with the light receiving area thereof defined by an opening in thelight shielding mask, is projected via the micro-lens 10. Likewise, afocus detection pupil 94 is formed as a photoelectric conversion unit14, with the light receiving area thereof defined by an opening in thelight shielding mask, is projected via the micro-lens 10. The pair offocus detection pupils 93 and 94 assume shapes achieving line symmetryrelative to a vertical line passing through the optical axis 91. Thepair of focus detection pupils 93 and 94 correspond to the pair of areasmentioned earlier. Via the micro-lens 10, the pair of photoelectricconversion units 13 and 14 and the pair of areas mentioned earlier,i.e., the pair of focus detection pupils 93 and 94, achieve a conjugaterelation to each other.

The pair of photoelectric conversion units 13 and 14 in each of thefocus detection pixels 311 disposed in the focus detection pixel rows L1through L8 extending along the horizontal direction in the focusdetection area 101 are set side-by-side along the horizontal direction,as are the focus detection pixels forming the focus detection pixelrows. The pair of photoelectric conversion units 13 and 14 respectivelyreceive the pair of focus detection light fluxes 73 and 74 arriving atthe corresponding micro-lens from the pair of focus detection pupils 93and 94 set side-by-side along the direction matching the direction inwhich the photoelectric conversion units 13 and 14 are set next to eachother. As the pairs of photoelectric conversion units 13 and 14 in theplurality of focus detection pixels 311 forming each focus detectionpixel row receive the pair of focus detection light fluxes 73 and 74, apair of image signals generated through photoelectric conversion, whichcorrespond to a pair of images formed with the pair of focus detectionlight fluxes 73 and 74, are repeatedly output over predetermined frameintervals.

The photoelectric conversion unit 13 in a focus detection pixel 311structured as described above outputs a signal corresponding to theintensity of an image formed on the micro-lens 10 of the focus detectionpixel 311 with the focus detection light flux 73 having passed throughthe focus detection pupil 93 and having advanced toward the micro-lens10. In addition, the photoelectric conversion unit 14 outputs a signalcorresponding to the intensity of an image formed on the micro-lens 10of the focus detection pixel 311 with the focus detection light flux 74having passed through the focus detection pupil 94 and having advancedtoward the micro-lens 10.

The outputs from the photoelectric conversion units 13 and 14 in thefocus detection pixels 311 disposed in the focus detection pixel row L1extending along the horizontal direction are integrated into outputgroups each corresponding to one of the two focus detection pupils 93and 94. Through this process, information related to the intensitydistributions of a pair of images formed on an array of focus detectionpixels 311 disposed in the focus detection pixel row L1 extending alongthe horizontal direction with the focus detection light fluxes 73 and 74passing through the focus detection pupil 93 and the focus detectionpupil 94, is obtained. Image shift detection operation processing(correlation arithmetic processing, phase difference detectionprocessing), to be detailed later, is subsequently executed by using theinformation thus obtained so as to detect an image shift amountrepresenting the extent of image shift manifested in the focus detectionpixel row L1 by the pair of images through a method known as thesplit-pupil phase detection method.

Likewise, based upon the signals output from the photoelectricconversion units 13 and 14 in the focus detection pixels 311 disposed inthe focus detection pixel rows L2 through L8 extending along thehorizontal direction, the image shift amounts, each indicating theextent of image shift manifested by the pair of images along thehorizontal direction in a given focus detection pixel row, can bedetected.

Then, by executing a conversion operation on the image shift amount incorrespondence to the proportional relation of the focus detection pupildistance to the interval between the gravitational centers of the pairof focus detection pupils 93 and 94, the deviation (defocus amount) ofthe current image-forming plane relative to the predeterminedimage-forming plane is calculated. In more specific terms, the defocusamount, i.e., the deviation of the image-forming plane relative to thepredetermined image-forming plane, manifesting along the direction inwhich the optical axis 91 extends, is calculated by multiplying theimage shift amount, indicating the extent of image shift occurringwithin the plane ranging perpendicular to the optical axis 91, by aspecific conversion coefficient. The specific conversion coefficient isa value obtained by dividing the focus detection pupil distance d by theinterval between the gravitational centers of the focus detection pupils93 and 94.

FIG. 7, which is to be referred to in comparison to FIG. 6, shows aphotographic light flux received at image-capturing pixels 310 of theimage-capturing element 212 shown in FIG. 4. FIG. 7 presents an enlargedschematic view of five successive image-capturing pixels 310, presentnear the photographic optical axis 91 in the image-capturing pixel rowextending along the horizontal direction, which is located next to thefocus detection pixel row L1 extending along the horizontal direction.It is to be noted that a repeated explanation of elements identical tothose in FIG. 6 will not be provided.

The image-capturing pixels 310 each comprise a micro-lens 10, aphotoelectric conversion unit 11 disposed to the rear of the micro-lensand the like. The shape of an opening in the light shielding maskpresent in close proximity to the photoelectric conversion unit 11 isprojected via the micro-lens 10 onto the exit pupil 90 set apart fromthe micro-lens 10 by the focus detection pupil distance d. The shape ofthe projected image defines an area 95 that substantially circumscribesthe focus detection pupils 93 and 94. The photoelectric conversion unit11 outputs a signal corresponding to the intensity of an image formed onthe micro-lens 10 with a photographic light flux 71 having passedthrough the area 95 and having advanced toward the micro-lens 10.Namely, the plurality of image-capturing pixels 310 receive thephotographic light flux 71 having originated from the subject and passedthrough the interchangeable lens 202, and output subject image signalscorresponding to the subject image resulting from photoelectricconversion over predetermined frame intervals.

FIG. 8 presents a flowchart of an image-capturing operation thatincludes the focus detection operation as part thereof, executed in thedigital still camera (image-capturing apparatus) 201 equipped with thefocus detection device achieved in the embodiment. As power to thedigital still camera 201 is turned on in step S100, the body drivecontrol device 214 starts the image-capturing operation to be executedin step S110 and subsequent steps. In step S110, the image-capturingelement control unit 220 in the body drive control device 214 reads outpixel data from all the pixels, and the CPU 222 in the body drivecontrol device 214 brings up a display at the liquid crystal displayelement 216 based upon the pixel data from the image-capturing pixels310. In the following step S120, the CPU 222 in the body drive controldevice 214 generates focus detection data, to be used for purposes offocus detection, based upon pixel data from focus detection pixels 311.The focus detection data generation processing executed in this stepwill be described in detail later.

In step S130, the CPU 222 in the body drive control device 214 executesa phase difference detection operation (image shift detection operation)for the focus detection area 101 based upon the focus detection data.The CPU 222 in the body drive control device 214 then calculates adefocus amount based upon the phase difference (image shift amount)detected through the phase difference detection operation.

In step S140, the CPU 222 in the body drive control device 214 makes adecision as to whether or not the current focusing condition is close tothe focus match state, i.e., whether or not the absolute value of thecalculated defocus amount is equal to or less than a predeterminedvalue. If it is decided that the current condition is not close to thefocus match state, the processing proceeds to step S150, in which theCPU 222 in the body drive control device 214 transmits the defocusamount to the lens drive control device 206 so as to drive, via the lensdrive control device 206, the focusing lens 210 in the interchangeablelens 202 to the focus match position. Subsequently, the processingreturns to step S110 to repeatedly execute the operation describedabove.

It is to be noted that the operation also branches to step S150 if focusdetection cannot be executed. In this case, the CPU 222 in the bodydrive control device 214 transmits a scan-drive instruction to the lensdrive control device 206 so as to scan-drive, via the lens drive controldevice 206, the focusing lens 210 in the interchangeable lens 202 overthe range between infinity and maximum close-up. The processing thenreturns to step S110 to repeatedly execute the operation describedabove.

If it is decided in step S140 that the current condition is close to thefocus match state, the processing proceeds to step S160. In step S160,the CPU 222 in the body drive control device 214 makes a decision as towhether or not a shutter release has occurred in response to anoperation at a shutter release button (not shown). If it is decided thata shutter release has not occurred, the processing returns to step S110to repeatedly execute the operation described above. If it is decidedthat a shutter release has occurred, the processing proceeds to stepS170. In step S170, the CPU 222 in the body drive control device 214transmits an aperture adjustment instruction to the lens drive controldevice 206 so as to adjust the aperture number at the interchangeablelens 202 to a control f-number (an f-number selected by the photographeror an automatically set f-number). Upon completion of the aperturecontrol, the image-capturing element control unit 220 in the body drivecontrol device 214 engages the image-capturing element 212 inimage-capturing operation and reads out pixel data from theimage-capturing pixels 310 and all the focus detection pixels 311 in theimage-capturing element 212.

In step S180, the CPU 222 in the body drive control device 214generates, through calculation, pixel data to be used as image datacorresponding to the positions occupied by the individual focusdetection pixels 311 based upon the pixel data from the focus detectionpixels 311 by adding together the data output from the pair ofphotoelectric conversion units 13 and 14 disposed in each focusdetection pixel 311. In the following step S190, the CPU 222 in the bodydrive control device 214 obtains the pixel data to be used as image datafrom the image-capturing pixels 310 and the image data corresponding tothe focus detection pixel positions and stores the data thus obtainedinto the memory card 219. These image data are obtained based upon thephotographic light flux 71 departing the subject and passing through theinterchangeable lens 202 when the focusing lens 210 in theinterchangeable lens 202 is at the focus match position. The processingthen returns to step S110 to repeatedly execute the operation describedabove.

It is to be noted that the operation in step S110 through step S160 isrepeatedly executed by interlocking with a frame readout operationthrough which the pixel data for one frame are cyclically read out fromthe image-capturing element 212 over predetermined frame intervals.

The image shift detection operation processing (correlation arithmeticprocessing, phase difference detection processing) executed in step S130in FIG. 8 will be described in detail below. Since the focus detectionpupils 93 and 94 may be vignetted by the aperture opening at the lens, aperfect balance may not be achieved with regard to the amounts of lightin the pair of images detected via the focus detection pixels 311.Accordingly, in step S130, the CPU 222 in the body drive control device214 executes a specific type of correlation operation that allows adesired level of image shift detection accuracy to be maintained inspite of the imbalance in the amounts of light. The correlationoperation is executed on a pair of focus detection image signals A1_(n),(A1₁, . . . , A1_(M): M represents the number of signals) and A2_(n)(A2₁, . . . , A2_(M)), as expressed in correlation operation expression(1) in the known art, which is disclosed in Japanese Laid Open PatentPublication No. 2007-333720, so as to calculate a correlation quantityC(k). In expression (1), the Σ operation is cumulatively executed withregard to the variable n. The range assumed for the variable n islimited to the range over which the data A1_(n), A1_(n+1), A2_(n+k) andA2_(n+1+k) exist in correspondence to the image shift amount k. Theimage shift amount k is an integer that represents a relative shiftamount assuming a value taken in units matching the data interval withwhich the data in the signal strings constituting the pair of signalsare sampled.C(k)=Σ|A1_(n) ·A2_(n+1+k) −A2_(n+k) ·A1_(n+1)|  (1)

Provided that a minimum value C(X) among values taken for a correlationquantity C(x) represented by a continuous line in correspondence to thecorrelation quantity C(k) calculated to take on discrete values asexpressed in (1) above is ascertained, a shift amount X, at which theminimum value C(X) among the values of the correlation quantities C(x)represented by a continuous line, is achieved, is converted to an imageshift amount shft as expressed in (2) below. The coefficient PY inexpression (2) represents the pixel pitch with which the focus detectionpixels 311 in the focus detection pixel rows L1 through L8 are disposed,i.e., a value twice the pixel pitch with which pixels are arrayed at theimage-capturing element 212.shft=PY·X  (2)

In reference to the processing flowchart presented in FIG. 9, the focusdetection data generation executed based upon the pixel data from focusdetection pixels 311 in step S120 in FIG. 8 will be described in detail.N focus detection pixels 311 are disposed in each focus detection pixelrow among the focus detection pixel rows L1 through L8 in FIG. 4. Theletter n (n=numeral 1˜N) indicates the position taken along thehorizontal direction by a given focus detection pixel 311 disposed in afocus detection pixel row Lp (p=1, 2, . . . , 8). The sth (s=1, 2)photoelectric conversion unit in the pair of photoelectric conversionunits 13 and 14 in the nth focus detection pixel 311 in the focusdetection pixel row Lp outputs data B(s, n, p). Namely, the pair ofphotoelectric conversion units 13 and 14 output a pair of sets of dataB(1, n, p) and B(2, n, p) respectively.

In step S200, the CPU 222 in the body drive control device 214 checksthe values indicated in the pixel data from the focus detection pixels311 disposed in the focus detection pixel row L1 in FIG. 3 so as todetermine whether or not the largest value indicated by the pixel dataexceeds a predetermined threshold value T1. Namely, it checks the pixeldata to determine whether or not the condition expressed in (3) issatisfied. If the largest value indicated by the pixel data from thefocus detection pixels 311 in the focus detection pixel row L1 exceedsthe predetermined threshold value T1, the output level at the focusdetection pixels 311 is sufficiently high for focus detection. Max ( )in expression (3) is a function for determining the largest value.Max(B(s,n,1))>T1  (3)

If it is decided in step S200 that the condition expressed in (3) issatisfied, the processing proceeds to step S210. In step S210, the CPU222 in the body drive control device 214 designates the pixel data fromthe focus detection pixels 311 disposed in the focus detection pixel rowL1 (p=1) as focus detection data B0(s, n) as expressed in (4) below. Theprocessing then proceeds to step S310.B0(s,n)=B(s,n,1)s=1,2 and n=1˜N  (4)

If, on the other hand, it is decided in step S200 that the conditionexpressed in (3) is not satisfied, the processing proceeds to step S220.In step S220, the CPU 222 in the body drive control device 214 adds upthe pixel data from the focus detection pixels 311 in the focusdetection pixel row L1 and the pixel data from the focus detectionpixels 311 in the focus detection pixel row L2, i.e., the next focusdetection pixel row following the focus detection pixel row L1, throughspatial accumulation. Data B1(s, n, 2) are obtained through the spatialaccumulation operation executed as expressed in (5) below to add up thedata output from the matching photoelectric conversion units in focusdetection pixels disposed at matching positions along the horizontaldirection, i.e., sharing a common value for the variable n. Inexpression (5), s=1, 2 and n=1˜N.B1(s,n,2)=B1(s,n,1)+B(s,n,2)  (5)

Namely, the pixel data from the focus detection pixels 311 set closestto each other along the vertical direction are spatially accumulated(spatial accumulation) as indicated in expression (5), and thus, dataB1(s, n, p) corresponding to the focus detection pixels 311 are obtainedthrough spatial accumulation operations executed as described above inconjunction with focus detection pixel rows L1 through Lp. It is to benoted that the data B1(s, n, 1) are identical to the data B(s, n, 1).

In step S230, the CPU 222 in the body drive control device 214 checksthe data B1(s, n, p) (p=2 when the processing in this step is executedfor the first time) generated through the spatial accumulation todetermine whether or not the largest value indicated by the data exceedsthe predetermined threshold value T1, i.e., whether or not the conditionexpressed in (6) below is satisfied. In expression (6), s=1, 2 andn=1˜N.Max(B1(s,n,p))>T1  (6)

If it is decided in step S230 that the condition expressed in (6) issatisfied, the processing proceeds to step S240. In step S240, the CPU222 in the body drive control device 214 designates the data B1 (s, n,p) corresponding to the focus detection pixels 311, obtained through thespatial accumulation operations executed up to the focus detection pixelrow Lp, as focus detection data B0(s, n) as expressed in (7) below. Theprocessing then proceeds to step S310. In expression (7), s=1, 2 andn=1˜N.B0(s,n)=B1(s,n,p)  (7)

If, on the other hand, it is decided in step S230 that the conditionexpressed in (6) is not satisfied, the processing proceeds to step S240.In step S240, the CPU 222 in the body drive control device 214 checksthe number of spatial accumulation operations executed so far todetermine whether or not a spatial accumulation operation has beenexecuted up to the focus detection pixel row L8, i.e., whether or notthe number of times the accumulation operation has been executed isequal to the maximum number of accumulation operations of 7. If it isdecided that the spatial accumulation processing has not been executedthrough the focus detection pixel row L8 yet, the processing returns tostep S220. In step S220, the CPU 222 in the body drive control device214 executes a spatial accumulation operation as expressed in (8) belowso as to calculate cumulative values by adding data B(s, n, p+1) fromthe focus detection pixels 311 disposed in the next focus detectionpixel row L(p+1) to the data B1(s, n, p) corresponding to the focusdetection pixels 311 in conjunction with which the spatial accumulationoperations have been executed so far. In expression (8), s=1, 2 andn=1˜N.B1(s,n,p+1)=B1(s,n,p)+B(s,n,p+1)  (8)

As the processing cycles through the loop formed with step S220, stepS230 and step S240 and it is finally decided in step S240 that thenumber of spatial accumulation operations executed so far has reachedthe maximum number of accumulation operations, i.e., when there are nomore focus detection pixel rows and thus, no more spatial accumulationoperations can be executed, the processing proceeds to step S260. Inthis case, spatially accumulated data B2(s, n, 0) will have beenobtained for the most recent frame by spatially accumulating the datafrom the focus detection pixels 311 disposed in the focus detectionpixel rows L1 through L8. In step S260, the CPU 222 in the body drivecontrol device 214 reads out the pixel data from the focus detectionpixels 311, stored in the internal memory 223 for the frame preceding by1 frame, and executes a spatial accumulation operation as expressed in(9) below with the data from the focus detection pixels 311 disposed inthe focus detection pixel rows L1 through L8. Through this step,spatially accumulated data B2(s, n, v) are obtained in conjunction withthe data output from the focus detection pixels 311 for the framepreceding the most recent frame by v frames (v=1 when the processing instep S260 is executed for the first time). It is assumed that the oldestdata held in the internal memory 223 are the focus detection pixel datacorresponding to the frame preceding the most recent frame by 10 frames(v=10). In the expression (9), the Σ operation is executed for p=1˜8.B2(s,n,v)=ΣB(s,n,p)  (9)

In step S270, the CPU 222 in the body drive control device 214 executesa temporal accumulation operation, as expressed in (10) below, so as tocalculate cumulative values by adding the spatially accumulated dataB2(s, n, v), calculated in step S260 for the frame preceding by 1 frame,to temporally accumulated data B3(s, n, v−1) obtained in conjunctionwith the frames with which the temporal accumulation operation has beenexecuted so far. In expression (10), s=1, 2 and n=1˜N.B3(s,n,v)=B3(s,n,v−1)+B2(s,n,v)  (10)

Namely, the spatially accumulated data for temporally successive pastframes are temporally accumulated (temporal accumulation) as expressedin (10) and as a result, the temporally accumulated data B3(s, n, v) areobtained. The temporally accumulated data B3(s, n, v) are focusdetection pixel data obtained by temporally accumulating the spatiallyaccumulated data B2(s, n, v) corresponding to the most recent framethrough the frame preceding the most recent frame by v frames. It is tobe noted that the temporally accumulated data B3(s, n, 0) are the sameas the spatially accumulated data B2(s, n, 0) and also identical to thedata B1(s, n, 8).

In step S280, the CPU 222 in the body drive control device 214 checksthe data B3(s, n, v) obtained through the temporal accumulation todetermine whether or not the largest value indicated by the data exceedsthe predetermined threshold value T1, i.e., whether or not the conditionexpressed in (11) is satisfied. When the decision-making processing instep S280 is executed for the first time v=1.Max(B3(s,n,v))>T1  (11)

If it is decided in step S280 that the condition expressed in (11) issatisfied, the processing proceeds to step S290. In step S290, the CPU222 in the body drive control device 214 designates the temporallyaccumulated data B3(s, n, v), obtained by temporally accumulating thefocus detection pixel data corresponding to the most recent framethrough the frame preceding the most recent frame by v as focusdetection data B0(s, n), as expressed in (12) below. In expression (12),s=1, 2 and n=1˜N. The processing then proceeds to step S310.B0(s,n)=B3(s,n,v)  (12)

If, on the other hand, it is decided in step S280 that the conditionexpressed in (11) is not satisfied, the processing proceeds to stepS300. In step S300, the CPU 222 in the body drive control device 214checks the number of temporal accumulation operations that have beenexecuted to determine whether or not the temporal accumulation operationhas been executed for the frame preceding the most recent frame by 10,i.e., whether or not the number of temporal accumulation operationsexecuted so far has reached the maximum number of 10. If it is decidedthat the temporal accumulation operation for the frame preceding themost recent frame by 10 has not been executed yet, the processingreturns to step S260, in which the CPU 222 in the body drive controldevice 214 executes a spatial accumulation operation for the past frameimmediately preceding the frame for which the temporal accumulationoperation has been executed most recently. The processing thus cyclesthrough the loop constituted with the steps S260, S270, S280 and S300again.

Upon deciding in step S300 that the number of temporal accumulationoperations executed thus far has reached the maximum number of 10, theCPU 222 in the body drive control device 214 designates the temporallyaccumulated data B3(s, n, 10), obtained by temporally accumulating thefocus detection pixel data corresponding to the most recent framethrough the frame preceding the most recent frame by 10, as focusdetection data B0(s, n) in step S290. The processing then proceeds tostep S310.

In step S310, the pixel data output from the focus detection pixels 311for the most recent frame are stored into the internal memory 223 inpreparation for the focus detection operation processing to be executedfor the next frame. The processing is then directed to proceed to stepS130 in the flowchart presented in FIG. 8. At this time, the focusdetection data B0(s, n) are read and used as the pair of image signalsA1 _(n)(A1 ₁, . . . , A1 _(M): M indicates the number of sets of data),A2 _(n)(A2 ₁, . . . , A2 _(M)) for focus detection executed as expressedin (1).

The operations described in reference to the flowchart presented in FIG.9 are illustrated in FIG. 10 and FIG. 11 from the viewpoint of dataprocessing. In the graphs presented in FIG. 10 and FIG. 11, the datavalue is indicated along the vertical axis and the data position (takenalong the horizontal direction) is indicated along the horizontal axis.FIG. 10 indicates that as the focus detection pixel data aresequentially added up through spatial accumulation, starting with thefocus detection pixel row L1, spatially accumulated data are generated.It is to be noted that the figure only shows the spatial accumulation ofone of the pair of image signals (s=1) for simplification. FIG. 10illustrates how spatial accumulation processing is executed inconjunction with the data output from the focus detection pixels 311 forthe most recent frame. FIG. 10 indicates that if the largest valueindicated by the pixel data from the focus detection pixels 311 disposedin the focus detection pixel row L1 does not exceed the predeterminedthreshold value T1, the data from the focus detection pixels 311 in thefocus detection pixel rows L2, L3, . . . are added up in sequence withthe pixel data from the focus detection pixels 311 in the focusdetection pixel row L1 for spatial accumulation and that if even thelargest value indicated by the spatially accumulated data obtained byadding up the pixel data from the focus detection pixels 311 in thefocus detection pixel row L8 does not exceed the predetermined thresholdvalue T1, the processing proceeds to the temporal accumulationprocessing illustrated in FIG. 11. In the spatial accumulationprocessing executed in conjunction with the plurality of focus detectionpixel rows, the data from the focus detection pixels in different pixelrows assuming the same value for n, i.e., taking up matching pixelpositions along the horizontal direction, are added together. The focusdetection pixels, the data from which are added together for spatialaccumulation, are disposed closest to each other along the verticaldirection.

As FIG. 11 indicates, if the largest value indicated by the spatiallyaccumulated data for the most recent frame does not exceed thepredetermined threshold value T1, spatially accumulated data aretemporally accumulated in sequence for temporal accumulation, by addingthe spatially accumulated data for the immediately preceding frame tothose corresponding to the most recent frame, then adding the spatiallyaccumulated data corresponding to the frame preceding the most recentframe by 2, . . . , and finally adding the spatially accumulated datacorresponding to the frame preceding the most recent frame by 10. Oncethe largest value indicated by the temporally accumulated data obtainedby temporally accumulating spatially accumulated data exceeds thepredetermined threshold value T1, the temporal accumulation processingends.

FIG. 12 presents a timing chart of the operation described in referenceto the flowchart presented in FIG. 8. In the operation shown in FIG. 12,the pixel data output from the image-capturing pixels and focusdetection pixels are read out from the image-capturing element 212 at aspecific frame rate (e.g., 1/60 sec). FIG. 12 shows the operationexecuted over four frames from a (N−1)th frame through a (N+2)th frame.The operation executed in correspondence to the Nth frame will bedescribed as a typical example. First, the image data (pixel data fromthe image-capturing pixels 310 and the pixel data from the focusdetection pixels 311) for the Nth frame, generated by storing electricalcharges during the (N−1)th frame readout, are read from theimage-capturing element 212. At the same time, electric charge storagefor the (N+1)th frame starts at the image-capturing element 212. Oncethe image data readout is completed, the live view image display isupdated based upon the pixel data from the image-capturing pixel 310having been read out. In addition, the defocus amount corresponding tothe Nth frame generation time point is calculated through focusdetection operation executed based upon the pixel data output from thefocus detection pixels 311 in correspondence to the Nth frame and thepixel data (signals) corresponding to the focus detection pixels 311stored for the (N−1)th frame and preceding frames at the (N−1)th framegeneration time point. Based upon the defocus amount thus calculated,focus adjustment is executed and the pixel data (signals) output fromthe focus detection pixels 311 for the Nth frame are stored into theinternal memory 223. This operation is repeatedly executed forsuccessive frames.

In the embodiment described above, a plurality of focus detection pixels311 are disposed in each of the eight focus detection pixel rows L1through L8 extending along the horizontal direction, as illustrated inFIG. 4, and spatial accumulation operations are executed to a maximum of7 times to add up the pixel data from the focus detection pixels 311along the vertical direction. However, the present invention is notlimited to this example and it may be adopted in conjunction with anynumber of focus detection pixel rows Lp equal to or greater than eight.The upper limit to the number of spatial accumulation operations thatmay be executed (maximum number of accumulation operations) may bedetermined through testing so as to ensure that a lowered high-frequencycomponent in the image, attributable to the vertical spatialaccumulation, will not result in poor focus detection accuracy. Forinstance, the upper limit Nmax for the number of spatial accumulationoperations N can be determined by ensuring that the condition expressedin (13) below is satisfied in conjunction with focus detection pixels311 disposed in every other row as shown in FIG. 4 with a pixel pitchPa.N≦Nmax=Ca/(2·Pa)  (13)

The constant Ca, which is determined through testing, is dependent uponthe lowest spatial frequency at which the required level of focusdetection accuracy can be sustained on the predetermined focal plane.Since higher focus detection accuracy is assured at a higher spatialfrequency, the constant Ca may be set, for instance, as the reciprocalof the lowest spatial frequency. Thus, when the lowest spatial frequencyis 10 lines/mm, the constant Ca will be 100 μm. Assuming that the pixelpitch Pa is 5 μm, the intervals between the focus detection pixels willbe twice the pixel pitch Pa, i.e., 10 μm, and accordingly, Nmax will becalculated as 100 μm/10 μm=10, as expressed in (13). In addition, byadjusting the lowest spatial frequency in correspondence to photographicfactors that are bound to affect the focus detection accuracy, such asthe extent of image movement, the extent of camera vibration, theaperture number set at the photographic lens, the brightness in thephotographic field, the photographic mode selected at the camera (stillsubject photographing mode/moving subject photographing mode) and thelike, an upper limit Nmax to the number of spatial accumulationoperations N, optimal for a specific focus detection operation, can beselected in a flexible manner.

An explanation has been given on an example in which the focus detectionpixel data corresponding to each frame are directly stored into theinternal memory 223. However, since focus detection pixel data otherthan those corresponding to the most recent frame first undergo spatialaccumulation before they are used for focus detection data generation,the focus detection pixel data may be spatially accumulated (over eightrows) and the resulting spatially accumulated data may then be storedinto the internal memory 223 in the first place. For instance, whenupdating the signals stored in correspondence to a given frame in FIG.12, the focus detection pixel data for the particular frame may bespatially accumulated (over eight rows) and the resulting spatiallyaccumulated data (the spatially accumulated data for the Nth frame ifthe signals are being updated in correspondence to the Nth frame) may bestored into the internal memory 223. In this case, the spatiallyaccumulated data generated in correspondence to the past frames, havingbeen stored in the internal memory 223, will be used in focus detectionexecuted for the next frame. Since the need to spatially accumulate thefocus detection pixel data corresponding to the past frames each timethe focus detection processing is executed, the length of time requiredfor the arithmetic operation can be reduced and space in the internalmemory 223 can be saved as well through these measures.

In the embodiment described above, a decision as to whether or not tocontinuously execute the accumulation processing is made by checking theaccumulated data to determine whether or not the largest value indicatedby the accumulated data exceeds a predetermined threshold value as thefocus detection pixel data from individual rows along the verticaldirection are added up one at a time in the spatial accumulationprocessing or as the spatially accumulated data from individual pastframes are added up one at a time from the newest toward the oldest, inthe temporal accumulation processing. This type of processing isadvantageous in that focus detection is enabled even when subjectpatterns, different from one focus detection pixel row to another, areformed on the focus detection pixels or when the brightness in thephotographic field abruptly changes from frame to frame. In addition,accumulation processing such as that described above may be controlledby using another evaluation value indicating data characteristicsinstead of the largest value indicated by the accumulated data, such asthe average value among the values indicated by the accumulated data orthe contrast value (the difference between the largest value and thesmallest value).

Furthermore, as long as the spatial distance between the focus detectionpixels, the data from which are added together through spatialaccumulation, is small (in the example presented in FIG. 4, the focusdetection pixel rows L1 through L8 over which data are added togetherthrough spatial accumulation are spatially set apart along the verticaldirection by the maximum extent equivalent to only 14 pixels), it can bereasonably assumed that the focus detection pixels, the data from whichare added up for spatial accumulation, receive light forming asubstantially uniform subject pattern image. In addition, if the lengthof time required for temporal accumulation of the pixel data from eachframe is 1/60 sec and the maximum number of temporal accumulationoperations is set to approximately 10, as in step S300 in FIG. 9, theoverall temporal accumulation will be completed in ⅙ sec for the 10temporal accumulation operations, and under such circumstances, nosignificant error will result from the assumption that the brightnessremains uniform instead of changing from frame to frame.

By assuming such spatial uniformity and temporal uniformity, theprocessing executed as shown in FIG. 9 may be further simplified, asshown in FIG. 13. It is to be noted that during the stored signal updateprocessing executed in correspondence to each frame, the spatiallyaccumulated data resulting from spatial accumulation of the data outputfrom the focus detection pixels in correspondence to the particularframe, i.e., the spatially accumulated data B2(s, n, v) for the withframe, are stored into the internal memory 223.

In step S400, the CPU 222 in the body drive control device 214 checksthe values indicated in the focus detection pixel data so as todetermine whether or not the largest value indicated by the pixel dataexceeds a predetermined threshold value T1 (i.e., whether or not thecondition expressed in (3) is satisfied).

If it is decided in step S400 that the condition expressed in (3) issatisfied, the processing proceeds to step S410, in which the CPU 222 inthe body drive control device 214 designates the pixel data from thefocus detection pixels disposed in the focus detection pixel row L1 asfocus detection data as expressed in (4). The processing then proceedsto step S450.

If, on the other hand, it is decided in step S400 that the conditionexpressed in (7) is not satisfied, the processing proceeds to step S420,in which the CPU 222 in the body drive control device 214 checks thevalue obtained by dividing the predetermined threshold value T1 by thelargest value Max (B(s, n, 1)) indicated by the focus detection pixeldata to determine whether or not the whole number part Ns of theobtained value is equal to or smaller than the maximum number of spatialaccumulation operations, i.e., 8 (whether or not the condition expressedin (14) is satisfied).Ns<8  (14)

If it is decided in step S420 that the condition expressed in (14) issatisfied, the processing proceeds to step S430, in which the CPU 222 inthe body drive control device 214 spatially accumulates data up to thedata from the focus detection pixels 311 in the (Ns+1)th focus detectionpixel row L(Ns+1), as expressed in (15). Then, in step S440, the CPU 222in the body drive control device 214 designates the spatiallyaccumulated data B1(s, n, Ns+1) as the focus detection data B0(s, n).The processing then proceeds to step S450. It is to be noted that the Σoperation in expression (15) is executed for the variable m=1˜Ns+1. Inexpression (15), s=1, 2 and n=1˜N.B0(s,n)=B1(s,n,Ns+1)=ΣB(s,n,m)  (15)

In step S450, the CPU 222 in the body drive control device 214 generatesspatially accumulated data B4(s, n), to be stored into the internalmemory 223, as expressed in (16) below. The processing then proceeds tostep S510. It is to be noted that the Σ operation in expression (16) isexecuted for the variable m=1˜8. In expression (16), s=1, 2 and n=1˜N.B4(s,n)=B1(s,n,8)=ΣB(s,n,m)  (16)

If, on the other hand, it is decided in step S420 that the conditionexpressed in (14) is not satisfied, the processing proceeds to stepS460, in which the CPU 222 in the body drive control device 214 checksthe whole number part Nt of the value obtained by dividing thepredetermined threshold value T1 by the value 8 times the largest valueMax(B(s, n, 1)) indicated by the focus detection pixel data so as todetermine whether or not the whole number part Nt is equal to or greaterthan 10 (whether or not the condition expressed in (17) is satisfied).Nt>10  (17)

If it is decided in step S460 that the condition expressed in (17) issatisfied, the processing proceeds to step S470, in which the CPU 222 inthe body drive control device 214 determines the whole number part Nt tobe 10. The processing then proceeds to step S480. However, if it isdecided in step S460 that the condition expressed in (17) is notsatisfied, the processing directly proceeds to step S480.

In step S480, the CPU 222 in the body drive control device 214 generatesthrough calculation spatially accumulated data B2(s, n, 0) for the mostrecent frame, as expressed in (16), just as it does in step S450, byspatially accumulating the focus detection pixel data in the most recentframe from the focus detection pixel row L1 through the focus detectionpixel row L8.

In step S490, the CPU 222 in the body drive control device 214 generatesthrough calculation temporally accumulated data B3(s, n, Nt) asexpressed in (18) below by using the spatially accumulated data B2(s, n,0) for the most recent frame (referred to as an Nath frame) and thespatially accumulated data B2(s, n, 1) through B2(s, n, Nt) stored inthe internal memory 223 in correspondence to the past Nt frames. In stepS500, the CPU 222 in the body drive control device 214 designates thetemporally accumulated data B3(s, n, Nt) as focus detection data B0(s,n). It is to be noted that the Σ operation in expression (18) isexecuted for the variable m=0 Nt. In expression (18), s=1, 2 and n=1˜N.B0(s,n)=B3(s,n,Nt)=ΣB2(s,n,m)  (18)

In step S510, the CPU 222 in the body drive control device 214 storesthe spatially accumulated data generated for the most recent frame intothe internal memory 223 in preparation for the focus detection operationprocessing to be executed for the next frame. The processing is thendirected to proceed to step S130 in the flowchart presented in FIG. 8.

In the processing flow shown in FIG. 13, the number of spatialaccumulation operations and the number of temporal accumulationoperations are already set at the initial stage of the processing. Thisprocessing flow differs from that shown in FIG. 9 in that the need toexecute decision-making processing for each processing loop iseliminated and thus, the processing flow in FIG. 13 does not require asmuch time. Furthermore, since the spatially accumulated data are storedin correspondence to each frame, less memory capacity is required in theinternal memory 223.

Moreover, instead of storing the spatially accumulated datacorresponding to the individual frames into the internal memory 223,temporally accumulated data may be generated through calculation incorrespondence to each frame by adding up data over up to 10 past framesand the temporally accumulated data thus generated may be stored intothe internal memory 223.

Namely, in the stored signal update processing executed as shown in FIG.12 to update the signals stored in correspondence to each frame, dataobtained by adding up, through temporal accumulation, the spatiallyaccumulated data corresponding to the most recent frame to thetemporally accumulated data for up to 10 past frames having been storedin correspondence to the immediately preceding frame, are stored for anupdate. In this case, temporally accumulated data corresponding to themost recent frame through the frame preceding the most recent frame byup to v frames are stored in the internal memory 223. In reference toFIG. 14, which corresponds to FIG. 11, the use of such temporallyaccumulated data in focus detection, stored in the internal memory 223as described above, will be described. When the processing is executedin correspondence to the most recent frame, the temporally accumulateddata (i.e., the spatially accumulated data B2(s, n, 1)) for theimmediately preceding frame, the temporally accumulated data (B2(s, n,1)+B2(s, n, 2)) generated by adding up the data for the immediatelypreceding frame and the data for the frame preceding the most recentframe by 2, the temporally accumulated data (B2(s, n, 1)+B2(s, n,2)+B2(s, n, 3)) generated by adding together the data for theimmediately preceding frame, the data for the frame preceding the mostrecent frame by 2 and the data for the frame preceding the most recentframe by 3, . . . , are recorded in the internal memory 223. Iftemporally accumulated data B3(s, n, Nt) corresponding to the mostrecent frame through the frame preceding it by Nt are needed, the datacan be generated through temporal accumulation simply by adding thespatially accumulated data B2(s, n, 0) for the most recent framedirectly to the temporally accumulated data (B2(s, n, 1)+B2(s, n,2)+B2(s, n, 3)+ . . . , +B2(s, n, Nt)) corresponding to the frameimmediately preceding the most recent frame through the frame precedingthe most recent frame by Nt.

In this system, when generating through calculation temporallyaccumulated data to be used for purposes of focus detection, thetemporally accumulated data generated in advance by adding together thedata for the immediately preceding frame through the frame preceding themost recent frame by Nt through temporal accumulation, are ready to beread out from the internal memory 223. As a result, an improvement isachieved in the processing speed with which the focus detectionoperation is executed. In addition, a further improvement in theprocessing speed can be achieved by executing the arithmetic operationfor temporally accumulated data generation and updating the data storedin the internal memory 223 via a separate, dedicated arithmeticoperation circuit other than the CPU 222.

The digital still camera 201 configured as an image-capturing apparatusequipped with the focus detection device achieved in the firstembodiment described above includes the image-capturing element (imagesensor) 212 and the body drive control device 214.

A plurality of focus detection pixel rows L1 through L8 are formedparallel to one another at the image-capturing element 212. The focusdetection pixel rows L1 through L8 each form a focus detection pixel rowLp. The focus detection pixel row Lp is made up with a plurality offocus detection pixels 311 disposed along the horizontal direction. Theplurality of focus detection pixels 311 forming a given focus detectionpixel row Lp each receive a pair of focus detection light fluxes 73 and74 passing through a pair of focus detection pupils 93 and 94, which arepart of the exit pupil 90 of the interchangeable lens 202, setside-by-side along a direction parallel to the horizontal direction, inwhich the plurality of focus detection pixels 311 are disposed. Theimage-capturing element 212 repeatedly outputs, over a predeterminedframe interval, a pair of image signals A1 _(n) and A2 _(n)corresponding to a pair of images formed with the pair of focusdetection light fluxes 73 and 74 through photoelectric conversion ateach focus detection pixel row Lp.

Each time pairs of image signals A1 _(n) and A2 _(n) are output via theindividual focus detection pixel rows Lp after the predetermined frameinterval, the body drive control device 214 generates spatiallyaccumulated data B2(s, n, v) by adding the pair of image signals A1 _(n)and A2 _(n) output from the next focus detection pixel row or pairs ofimage signals A1 _(n) and A2 _(n) output from a plurality of focusdetection pixel rows succeeding the focus detection pixel row L1 amongthe focus detection pixel rows L1 through L8, to the pair of imagesignals A1 _(n) and A2 _(n) output from the focus detection pixel rowL1.

The body drive control device 214 generates temporally accumulated dataB3(s, n, v) through temporal accumulation by adding up the spatiallyaccumulated data B2(s, n, v) corresponding to the most recent framethrough the frame preceding the most recent frame by v, each generatedthrough calculation as the pairs of image signals A1 _(n) and A2 _(n)are output via the individual focus detection pixel rows Lp for theparticular frame after the predetermined frame interval.

The body drive control device 214 detects the focusing condition at theinterchangeable lens 202 based upon either the spatially accumulateddata B2(s, n, v) or the temporally accumulated data B3(s, n, v).

In the digital still camera 201 configured as an image-capturingapparatus equipped with the focus detection device achieved in the firstembodiment of the present invention as described above, precedence isgiven to spatial accumulation (cumulatively adding up the data from aplurality of focus detection pixels disposed close to one another) inthe generation of focus detection data, and if valid focus detectiondata assuring reliability (indicating a maximum value, an average valueor contrast value equal to or greater than a predetermined thresholdvalue) cannot be obtained through the spatial accumulation alone, dataare generated through temporal accumulation (by adding together the datafrom matching focus detection pixels output in correspondence to thecurrent frame and past frames). As a result, problems attributable totemporal accumulation such as poor focus detection accuracy due to achange occurring over time in the subject image or movement of thesubject, can be minimized and optimal autofocus adjustment is enabledeven under low light or low contrast conditions.

(Second Embodiment)

In the first embodiment described above, focus detection pixel data areadded together to calculate cumulative values with precedence given tospatial accumulation over temporal accumulation. The advantageous effectof the present invention is amply demonstrated in the second embodimentthrough spatial accumulation and temporal accumulation executed in anoptimal combination in correspondence to an existing condition such assubject movement or shaky hand movement of the camera.

The second embodiment adopts a structure identical to that of the firstembodiment and the flow of the overall operation executed therein issubstantially the same as that executed in the first embodiment (seeFIG. 8). The second embodiment is distinguishable in the processingexecuted for purposes of focus detection data generation. It is to benoted that the data stored in the internal memory 223 are updated sothat the focus detection pixel data (output from the focus detectionpixel rows L1 through L8) corresponding to the 10 frames, i.e., the mostrecent frame through the frame preceding the most recent frame by 10,are held in the internal memory 223.

In reference to the processing flowchart presented in FIG. 15, theprocessing executed in the second embodiment in step S120 in FIG. 8 togenerate focus detection data based upon focus detection pixel data willbe described in detail.

In step S600, the CPU 222 in the body drive control device 214 checksthe focus detection pixel data output from the focus detection pixels311 disposed in the focus detection pixel row L1 in FIG. 3 so as todetermine whether or not the largest value indicated by the focusdetection pixel data exceeds a predetermined threshold value T1 (i.e.,whether or not the condition expressed in (3) is satisfied).

If it is decided in step S600 that the condition expressed in (3) issatisfied, the processing proceeds to step S610, in which the CPU 222 inthe body drive control device 214 designates the pixel data from thefocus detection pixels disposed in the focus detection pixel row L1 asfocus detection data as expressed in (4). The processing then proceedsto step S680.

If, on the other hand, it is decided in step S600 that the conditionexpressed in (3) is not satisfied, the processing proceeds to step S620,in which the CPU 222 in the body drive control device 214 calculates anoverall number of accumulation operations P by adding 1 to the wholenumber part of the quotient of the predetermined threshold value T1divided by the largest value Max(B(s, n, 1)) indicated by the focusdetection pixel data.

In step S630, the CPU 222 in the body drive control device 214determines a frame-to-frame motion vector through a method of the knownart based upon the image data (the data output from the image-capturingpixels) for the most recent frame and the image data from theimmediately preceding frame and calculates a frame-to-frame movement Mvby taking the absolute value of the motion vector. It is to be notedthat the image data for the immediately preceding frame are held in thebuffer memory or in the internal memory 223.

In step S640, the CPU 222 in the body drive control device 214determines a number of spatial accumulation operations Ps and a numberof temporal accumulation operations Pt based upon the number ofaccumulation operations P and the movement Mv. This processing will bedescribed in detail later.

In step S650, the CPU 222 in the body drive control device 214 generatesspatially accumulated data for Pt frames through spatial accumulation byadding together the focus detection pixel data (the focus detectionpixel data output from the focus detection pixel rows L1 through L(Ps))in the most recent frame through the frame preceding the most recentframe by (Pt−1) based upon the number of spatial accumulation operationsPs.

In step S660, the CPU 222 in the body drive control device 214 generatestemporally accumulated data corresponding to the most recent framethrough the frame preceding the most recent frame by (Pt−1) by adding upthe spatially accumulated data for the Pt frames through temporalaccumulation.

In step S670, the CPU 222 in the body drive control device 214designates the temporally accumulated data as focus detection data. Theprocessing then proceeds to step S680.

In step S680, the CPU 222 in the body drive control device 214 storesthe focus detection pixel data corresponding to the most recent frameinto the internal memory 223 in preparation for the focus detectionoperation processing to be executed for the next frame. The processingis then directed to proceed to step S130 in the flowchart presented inFIG. 8.

FIG. 16 presents a graph in reference to which the processing executedin step S640 in FIG. 15 to determine the number of spatial accumulationoperations Ps and the number of temporal accumulation operations Pt willbe explained in detail.

In FIG. 16, a variable Px representing the number of spatialaccumulation operations is indicated along the horizontal axis, whereasa variable Py representing the number of temporal accumulationoperations is indicated along the vertical axis. The range of thevariable Px representing the number of spatial accumulation operationsis limited so that 1≦Px≦8, since there are eight focus detection pixelrows L1 through L8. In addition, since the data stored in the internalmemory 223 are updated so that data over the past 10 frames are heldtherein at any given time, the temporal operation can only be executedup to 11 frames including the most recent frame, as far as the number oftemporal accumulation operations Pt is concerned. In other words, therange for the variable Pt is limited to 1≦Pt≦11. Accordingly, everyconceivable combination of the number of spatial accumulation operationsPx and the number of temporal accumulation operations Py must fall intothe range (allowable range) in the shaded area in FIG. 16.

The product of the number of spatial accumulation operations Px and thenumber of temporal accumulation operations Py indicates the overallnumber of accumulation operations P. Namely, P=Px·Py. The values takenfor Px and Py, having a functional relation to each other, as describedabove, can be determined in correspondence to the value assumed for thenumber of accumulation operations P. FIG. 16 presents examples in whichP=88, p=p0 and P=1 (1<P0<88).

A function Py=K·Px is determined based upon the movement Mv. Thecoefficient K in this function is equal to D/Mv, which is the ratio ofthe pitch D between the focus detection pixel rows (e.g., the distancemeasured along the vertical direction between the focus detection pixelrow L1 and the next focus detection pixel row L2) to the movement Mv.Namely, when the movement Mv is large relative to the pitch D, theextent of image blur increases (the contrast is lowered) throughtemporal accumulation in excess of the increase in the extent of imageblur (lowered contrast) attributable to spatial accumulation.Accordingly, the coefficient K takes a smaller value under suchcircumstances, so as to keep down the number of temporal accumulationoperations Py.

When the movement Mv is small relative to the pitch D, on the otherhand, the extent of image blur attributable to spatial accumulationincreases (lowered contrast) in excess of the increase in the extent ofimage blur (lowered contrast) attributable to temporal accumulation.Under such circumstances, the coefficient K takes on a greater value soas to keep down the number of spatial accumulation operations Px. FIG.16 shows two different forms of the function Py=K·Px, one with thecoefficient K taking a large value (K=K0) and the other with thecoefficient K taking a small value (K=K1).

For instance, in conjunction with the overall number of accumulationoperations P0 and the coefficient K corresponding to the movement Mvtaking the value K0, the intersecting point at which the functionPx·Py=P0 and the function Py=K0·Px intersect each other is determined.Provided that the coordinates (Px0, Py0) of the intersecting point arewithin the allowable range, as indicated in FIG. 16, intersecting pointcoordinates (Pxs, Pyt) taking on integral values, which are closest tothe intersecting point coordinates (Px0, Py0) within the allowablerange, are determined, the number of spatial accumulation operations Psis set to Pxs and the number of temporal accumulation operations Pt isset to Pxt.

When the overall number of accumulation operations is P0 and thecoefficient K corresponding to the movement Mv is K1, on the other hand,the coordinates (Px1, Py1) of the intersecting point at which thefunction Px·Py=P0 and the function Py=K1·Px intersect each other areoutside the allowable range. Under such circumstances, the coordinatesare shifted from the intersecting point coordinates (Px1, Py1) along thefunction Px·Py=P0 until the coordinates are inside the allowable range((8, P0/8) in the example presented in FIG. 16), intersecting pointcoordinates (Pxs, Pyt) taking integral values, which are the closest to(8, P0/8) within the allowable range are determined, and the number ofspatial accumulation operations Ps is set to Pxs and the number oftemporal accumulation operations Pt is set to Pyt.

The processing described above is summarized as follows. Namely, for thenumber of spatial accumulation operations and the number of temporalaccumulation operations, the product of which sustains a constant value(P0), the value of the number of temporal accumulation operations andthe value of the number of spatial accumulation operations aredetermined so that the coefficient K takes a value in reverse proportionto the movement. The constant value P0, i.e., the product of the numberof spatial accumulation operations and the number of temporalaccumulation operations, is set so that the evaluation value (thelargest value, the average value, the contrast value or the like)indicating the data characteristics of the focus detection data exceedsthe predetermined threshold value T1 used in the first embodiment. Thenumber of spatial accumulation operations Px and the number of temporalaccumulation operations Py are set so that the number of temporalaccumulation operations Py never exceeds the number of spatialaccumulation operations Px and that the product of the number of spatialaccumulation operations Px and the number of temporal accumulationoperations Py is substantially equal to the constant value P0.

While the coefficient K in FIG. 16 is defined as the ratio of the pitchD to the movement Mv, the coefficient K may be defined as the ratio(K=D/Mv1) of the pitch D to an average movement Mv1, i.e., an averagevalue Mv1 of movements Mv over a plurality of frames. As a furtheralternative, the coefficient K may be defined as the ratio (K=D/Mv2) ofthe pitch D to vertical movement Mv2 of the motion vector. As anotheralternative, the coefficient K may be defined as the ratio (K=D/Mv3) ofthe pitch D to horizontal movement Mv3 of the motion vector.

In addition, as the direction of the motion vector becomes closer to thehorizontal direction, the focus detection accuracy is affected by thetemporal accumulation to a greater extent than the degree to which it isaffected by the spatial accumulation. Accordingly, the coefficient K maybe defined as the ratio (K=Mv2/Mv3) of the vertical movement Mv2 to thehorizontal movement Mv3.

Furthermore, instead of detecting a frame-to-frame motion vector, themovement may be detected via a dedicated motion detection deviceinstalled specifically for purposes of motion detection. Such adedicated motion detection device may be, for instance, an accelerationsensor installed in the body and in such a case, outputs from theacceleration sensor may be temporally integrated in correspondence toframe intervals so as to detect any movement of the camera (image blur)occurring within a single frame.

Moreover, the coefficient K does not need to be a value corresponding tomovement and may instead be a value corresponding to a factor thataffects the focus detection accuracy in relation to the temporalaccumulation and the spatial accumulation. For instance, the horizontalhigh-frequency component in images is highly likely to decrease throughtemporal accumulation and such a decrease in the horizontalhigh-frequency component is bound to result in lowered focus detectionaccuracy. Accordingly, the horizontal high-frequency component in animage may be determined through image processing and the coefficient Kmentioned above may be defined as a value that is in reverse proportionto the level of the high-frequency component.

In addition, when the defocus amount is significant, the high-frequencycomponent in the image is bound to be smaller due to blurring andaccordingly, the coefficient K may be defined as a value that is inproportion to the defocus amount determined through focus detection.

The number of spatial accumulation operations and the number of temporalaccumulation operations optimal for focus detection can be selected in aflexible manner by adjusting the coefficient K in correspondence toother photographic factors bound to affect the focus detection accuracy,such as the lens drive speed, the aperture number set at thephotographic lens, the brightness in the photographic field, thephotographic mode selected for the camera (still subject photographingmode or moving subject photographing mode) or the like.

In the second embodiment of the present invention described above, focusdetection data are generated by selecting optimal values for the numberof spatial accumulation operations (the number of times the data from aplurality of focus detection pixels disposed in close proximity to oneanother are added up to calculate cumulative values) and the number oftemporal accumulation operations (the number of times the data outputfrom matching focus detection pixels for past frames are added up), withthe combination of these values achieving an overall number ofaccumulation operations determined in correspondence to an evaluationvalue (e.g., the largest value, the average value or the contrast value)representing the data characteristics, based upon the extent of imagemovement or the like, so as to minimize image blur (lowered contrast)bound to result from spatial accumulation and temporal accumulation. Asa result, the problem attributed to data accumulation (compromised focusdetection accuracy due to lowered contrast) can be minimized, therebyassuring good autofocus adjustment even under low light or low contrastconditions.

While the image-capturing element 212 shown in FIG. 4 includes focusdetection pixels 311 each having a pair of photoelectric conversionunits, the present invention may instead be adopted in animage-capturing element that includes first focus detection pixels, eachhaving one photoelectric conversion unit (one of the pair ofphotoelectric conversion units), and a second focus detection pixels,each having one photoelectric conversion unit (the other photoelectricconversion unit in the pair), disposed at alternate positions.

In the embodiments described above, the pixel data from the focusdetection pixels 311 in a single focus detection pixel row or aplurality of focus detection pixel rows among the focus detection pixelrow L2 through Lp are added, starting with the focus detection pixel rowlocated closest to the focus detection pixel row L1, to the pixel datafrom the focus detection pixels 311 in the focus detection pixel row L1at the image-capturing element 212 shown in FIG. 4 so as to calculatecumulative data values through spatial accumulation. At theimage-capturing element 212 shown in FIG. 4, the focus detection pixelrows L2 through L8 are all located further downward relative to thefocus detection pixel row L1. However, the present invention may beadopted in an image-capturing element 212 such as that shown in FIG. 17,with focus detection pixel rows L2, L4, L6 and L8 disposed furtherdownward relative to the focus detection pixel row L1, the focusdetection pixel row L2 located closest to the focus detection pixel rowL1 and the focus detection pixel row L8 located furthest away from thefocus detection pixel row L1, and with focus detection pixel rows L3, L5and L7 disposed further upward relative to the focus detection pixel rowL1, the focus detection pixel row L3 located closest to the focusdetection pixel row L1 and the focus detection pixel row L7 locatedfurthest away from the focus detection pixel row L1. In this case too,spatial accumulation operations should be executed by adding the pixeldata from the focus detection pixel rows L2 through L8, starting withthe focus detection pixel row located closest to the focus detectionpixel row L1.

In the embodiments described above, the pixel data from the focusdetection pixels 311 in a single focus detection pixel row or aplurality of focus detection pixel rows among the focus detection pixelrow L2 through Lp are added, starting with the focus detection pixel rowlocated closest to the focus detection pixel row L1, to the pixel datafrom the focus detection pixels 311 in the focus detection pixel row L1at the image-capturing element 212 shown in FIG. 4 so as to calculatecumulative data values through spatial accumulation. Through thisspatial accumulation, the data B1(s, n, p) indicating cumulative valueseach calculated by adding data output from the photoelectric conversionunits belonging to a single type in focus detection pixels 311, takingup corresponding positions closest to each other along the verticaldirection and sharing the same value for the variable n indicating thehorizontal pixel position, are generated as expressed in (5).

As an alternative, spatial accumulation operations may be executed asexpressed in (19) so as to add up data output from focus detectionpixels disposed at positions, one shifted relative to the other by 1along the horizontal direction with the variable n at the oneincremented by 1 relative to the value taken for the variable n of theother, i.e., the data output from the photoelectric conversion unitsbelonging to the same type in focus detection pixels 311 disposedclosest to each other along a diagonal direction, as the distancebetween the focus detection pixel row L1 and the focus detection pixelrow Lp, the data from which are to be added for spatial accumulation ina sequence corresponding to the proximity to the focus detection pixelrow L1, increases, i.e., as the variable p takes on a greater value. Inexpression (19), s=1, 2, n=1˜N and p=1˜8.B1(s,n,p)=B1(s,n,p−1)+B(s,n+p−1,p)

As a further alternative, spatial accumulation operations may beexecuted as expressed in (20) and (21) below by switching the data to beadded up for spatial accumulation depending upon whether the focusdetection pixel row Lp is an odd-numbered focus detection pixel row withthe variable p taking an odd-numbered value or the focus detection pixelrow Lp is an even-numbered focus detection pixel row with the variable ptaking an even-numbered value, i.e., by shifting the horizontal positionback and forth, indicated by the variable n, of the focus detectionpixel, the data from which are to be added, by 1 depending upon whetherthe focus detection pixel row Lp is an odd-numbered focus detectionpixel row or an even-numbered focus detection pixel row, so as to addtogether the data output from the photoelectric conversion unitsbelonging to the same type in focus detection pixels 311 located closestto each other in a staggered pattern. In expression (20), p=1, 3, 5, 7whereas in expression (20), P=2, 4, 6, 8. In addition, in expressions(20) and (21), s=1, 2 and n=1˜N.B1(s,n,p)=B1(s,n,p−1)+B(s,n,p)  (20)B1(s,n,p)=B1(s,n,p−1)+B(s,n+1,p)  (21)

While the image-capturing element 212 achieved in the embodimentsdescribed above includes color filters disposed at the image-capturingpixels thereof in the Bayer array pattern, the structures of such colorfilters and the array pattern of the color filters are not limited tothose in the embodiments. The present invention may be adopted inconjunction with an array of complementary color filters (green: G,yellow: Ye and magenta: Mg, cyan: Cy) or in conjunction with anarrangement other than the Bayer array.

While the image-capturing pixels and the focus detection pixels aredisposed together on the image-capturing element achieved in theembodiments described above, the present invention may be adopted in aconfiguration that includes a mirror disposed in the optical path, viawhich light fluxes are separated to be directed to an image-capturingelement constituted with image-capturing pixels alone and to a focusdetection element (image sensor) constituted with focus detection pixelsalone.

It is to be noted that an image-capturing apparatus is not limited to adigital camera, with an interchangeable lens mounted at the camera body,as described above. For instance, the present invention may instead beadopted in a digital camera with an integrated lens, a film still cameraor in a video camera. Furthermore, it may also be adopted in a compactcamera module built into a mobile telephone or the like, in a visualrecognition device in a surveillance camera or a robotic optical system,in a vehicular onboard camera or the like.

REFERENCE SIGNS LIST

-   10 micro-lens-   11, 13, 14 photoelectric conversion unit-   15 element separation area-   71 photographic light flux-   73, 74 focus detection light flux-   90 exit pupil-   91 optical axis-   93, 94 focus detection pupil-   95 area-   101 focus detection position-   201 digital still camera-   202 interchangeable lens-   203 camera body-   204 mount unit-   206 lens drive control device-   208 zooming lens-   209 lens-   210 focusing lens-   211 aperture-   212 image-capturing element-   213 electrical contact point-   214 body drive control device-   215 liquid crystal display element drive circuit-   216 liquid crystal display element-   217 eyepiece lens-   219 memory card-   220 image-capturing element control unit-   221 buffer memory-   222 CPU-   223 internal memory-   310 image-capturing pixel-   311 focus detection pixel

The invention claimed is:
 1. A focus detection device, comprising: animage sensor that includes a first number of focus detection units, eachfocus detection unit having a plurality of focus detection pixelsdisposed along a first direction, each focus detection pixel outputtinga first signal and a second signal, and the first number of focusdetection units arranged in a second direction that is different fromthe first direction; and a processor that calculates a first additionvalue by adding together first signals output from the focus detectionpixels arranged along the second direction in the first number of focusdetection units and calculates a second addition value by addingtogether second signals output from the focus detection pixels arrangedalong the second direction in the first number of focus detection units,the processor detecting a focusing condition at an optical system basedupon the first addition value and the second addition value, wherein:until a first cumulative value based upon the first addition value andthe second addition value exceeds a threshold value, the processorcalculates the first addition value by adding together a second numberof the first signals and calculates the second addition value by addingtogether the second number of the second signals, the second numberbeing set so as not to exceed the first number.
 2. An image-capturingapparatus, comprising: a focus detection device according to claim 1;and a drive control device that drives the optical system to a focusposition based upon the focusing condition detected by the processor,wherein: the processor obtains image data based upon a photographiclight flux having originated from a subject and passed through theoptical system when the optical system is set at the focus position. 3.The focus detection device according to claim 1, wherein the processorfurther calculates temporally accumulated values based upon the firstaddition value and the second addition value; the first number of focusdetection units each repeatedly output the first signals and the secondsignals; the processor repeatedly calculates the first addition value byadding together the first signals output from the first number of focusdetection units and repeatedly calculates the second addition value byadding together the second signals output from the first number of focusdetection units; the processor calculates the temporally accumulatedvalues by adding up a third number of first addition values and thethird number of second addition values obtained as the processorrepeatedly calculates the first addition value and the second additionvalues; and the processor detects the focusing condition based upon oneof the first addition value and the second addition value, and thetemporally accumulated values calculated based upon the first additionvalue and the second addition value.
 4. The focus detection deviceaccording to claim 3, wherein: the focus detection units each repeatedlyoutput the first signals and the second signals corresponding to a firstimage and a second image formed with a first focus detection light fluxand a second focus detection light flux, generated through photoelectricconversion.
 5. The focus detection device according to claim 4, wherein:the plurality of focus detection pixels forming the focus detectionunits each receive the first and second focus detection light fluxeshaving passed through a first area and a second area that are part of anexit pupil of the optical system and are set side-by-side along adirection parallel to the first direction; and the first number of focusdetection units are disposed so as to extend parallel to one another. 6.The focus detection device according to claim 4, wherein: the pluralityof focus detection pixels each include a micro-lens through which thefirst and second focus detection light fluxes pass and a firstphotoelectric conversion unit and a second photoelectric conversion unitset side-by-side along the first direction, where the first and secondfocus detection light fluxes received thereat undergo photoelectricconversion; and via the micro-lens, the first and second photoelectricconversion units and a first area and a second area through which thefirst and second focus detection light fluxes pass, set side-by-sidealong a direction parallel to the first direction as part of an exitpupil of the optical system, achieve a conjugate relation to each other.7. The focus detection device according to claim 6, wherein: a pluralityof image-capturing pixels that output subject image signalscorresponding to a subject image generated through photoelectricconversion of a photographic light flux, having originated from asubject, passed through the optical system and received thereat, aredisposed at the image sensor in combination with the plurality of focusdetection pixels.
 8. The focus detection device according to claim 4,wherein: the second number and the third number are determined so thatan evaluation value calculated based upon the first signals and thesecond signals exceeds the threshold value in a case where the processordetects the focusing condition based upon the temporally accumulatedvalues.
 9. The focus detection device according to claim 8, wherein: theprocessor further detects an extent of movement occurring frame to framein images formed on the image senor; and in a case where the processordetects the focusing condition based upon the temporally accumulatedvalues, the second number and the third number are determined so that avalue taken for the third number becomes smaller relative to a valuetaken for the second number as the extent of movement increases and thata product of the second number and the third number is substantiallyequal to a constant value corresponding to the evaluation value and thethreshold value.
 10. The focus detection device according to claim 9,wherein: the evaluation value corresponds to one of an average value ofvalues indicated by the first signals and the second signals, a largestvalue indicated by the first signals and the second signals and adifference between the largest value and a smallest value indicated bythe first signals and the second signals.
 11. The focus detection deviceaccording to claim 8, wherein: in a case where the processor detects thefocusing condition based upon the first addition value and the secondaddition value, the evaluation value is the first cumulative valuedetermined based upon the first addition value and the second additionvalue, with the second number set within a range not exceeding the firstnumber and the third number set to 0 so that the first cumulative valueexceeds the threshold value; and wherein in a case where the processordetects the focusing condition based upon the temporally accumulatedvalues, the evaluation value is a second cumulative value determinedbased upon the temporally accumulated values, with the second number setto the first number and the third number set so that the secondcumulative value exceeds the threshold value.
 12. The focus detectiondevice according to claim 11, further comprising: a storage device inwhich the first signals and second signals repeatedly output by each ofthe focus detection units are stored, wherein: the processor calculatesthe first addition value and the second addition value by addingtogether the first signals and adding together the second signals storedin the storage device.
 13. The focus detection device according to claim11, further comprising: a storage device in which the first additionvalues and the second addition values repeatedly calculated by theprocessor based on the first signals and the second signals output byeach of the focus detection units are stored, wherein: the processorcalculates the temporally accumulated values by adding up the thirdnumber of the first addition values and the third number of the secondaddition values stored in the storage device.
 14. The focus detectiondevice according to claim 11, further comprising: a storage device inwhich the temporally accumulated values calculated by the processor arestored, wherein: for detecting the focusing condition based upon thetemporally accumulated values, the processor detects the focusingcondition based upon the temporally accumulated values stored in thestorage device.
 15. The focus detection device according to claim 11,wherein: the first cumulative value and the second cumulative valuecorrespond to an average value of the first addition values and thesecond addition values and an average value of the temporallyaccumulated values, a largest value of the first addition values and thesecond addition values and a largest value of the temporally accumulatedvalues, or a difference between the largest value and the smallest valueof the first addition values and the second addition values and adifference between the largest value and the smallest value of thetemporally accumulated values.